package package1;

 class Dog extends Animal727{
    String color;
    {
        this.color="red";
        System.out.println("执行了实例代码块----");
    }
    static{
        System.out.println("静态代码块给静态成员变量赋值-----");
    }
    public Dog(String name,int age,String color){
        super(name,age);//因为父类自己有构造方法且含参必须手动调用父类构造方法
        this.color=color;
        System.out.println("执行了Dog的构造方法----");
    }
    public void wawa() {
        System.out.println(this.name+"正在汪汪叫-----");
    }

     @Override
     public String toString() {
         return "Dog{" +
                 "color='" + color + '\'' +
                 ", name='" + name + '\'' +
                 ", age=" + age +
                 '}';
     }
     public  void fun2() {
        super.fun1();
     }
 }
